---
id: "unboxed-decorator"
keywords: ["unboxed", "decorator"]
name: "@unboxed"
summary: "This is the `@unboxed` decorator."
category: "decorators"
---

The `@unboxed` decorator provides a way to unwrap **variant** constructors
that have no overlap in their runtime representation, or **record** objects that have a _single_ field.

### Example

<CodeTab labels={["ReScript", "JS Output"]}>

```res
@unboxed
type listItemValue = String(string) | Boolean(bool) | Number(float)
let myArray = [String("Hello"), Boolean(true), Boolean(false), Number(13.37)]
let studentName = Name("Joe")

@unboxed
type greeting = {message: string}
let hi = {message: "hello!"}
```

```js
var myArray = ["hello", true, false, 13.37];
var hi = "hello!";
```

</CodeTab>

_`@unboxed` for variants with multiple constructors is available since ReScript `11.0.0`._

### References

- [Untagged variants doc](../docs/manual/variant.mdx#untagged-variants)
- [Better Interop with Customizable Variants](../blog/improving-interop.mdx)
